
<!DOCTYPE html>
<html lang="en" class="no-js">

<head>

<meta charset="utf-8">
<title>红旗渠干部学院教学管理系统</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<!-- CSS -->

<link href="__PUBLIC__/login/css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
	<script src=""__PUBLIC__/login/js/html5.js"></script>
<![endif]-->
<script src="__PUBLIC__/login/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/login/js/jquery.form.js"></script>
<script type="text/javascript" src="__PUBLIC__/login/js/tooltips.js"></script>
<script type="text/javascript" src="__PUBLIC__/login/js/login.js"></script>
<style>
    .main_box {
    position: absolute; top:50%; left:50%; margin-top:-260px; margin-left: -300px; padding: 30px; width:600px; height:460px;
	background:url(__PUBLIC__/login/images/1.png);
    border-radius: 10px;
}
.main_box .setting {position: absolute; top: 5px; right: 10px; width: 10px; height: 10px;}
.main_box .setting a {color: #FF6600;}
.main_box .setting a:hover {color: #555;}
.login_logo {margin-bottom: 20px; height: 45px; text-align: center;}
.login_logo img {height: 45px;}
.login_msg {text-align: center; font-size: 16px;}
.login_form {padding-top: 20px; font-size: 16px;}
.login_box .form-control {display: inline-block; *display: inline; zoom: 1; width: auto; font-size: 18px;}
.login_box .form-control.x319 {width: 319px;}
.login_box .form-control.x164 {width: 164px;}
.login_box .form-group {margin-bottom: 20px;}
.login_box .form-group label.t {width: 120px; text-align: right; cursor: pointer;}
.login_box .form-group.space {padding-top: 15px; border-top: 1px #FFF dotted;}
.login_box .form-group img {margin-top: 1px; height: 32px; vertical-align: top;}
.login_box .m {cursor: pointer;}
.bottom {text-align: center; font-size: 12px;}
 

    
    
</style>
</head>

<body>

<div class="page-container">
	<div class="main_box">
		<div class="login_box">
		
		
			<div class="login_form">
				<form action="" id="frm" method="post">
					<div class="form-group">
						<label for="username" class="t">用户名：</label> 
						<input id="loginname" value="{$loginname}" name="loginname"  readonly="readonly" type="text" class="form-control x319 in" >
					</div>
					<div class="form-group">
						<label for="opassword" class="t">旧密码：</label> 
						<input id="opassword" value="" name="opassword" type="password" 
						class="password form-control x319 in">
					</div>
					<div class="form-group">
						<label for="password" class="t">新密码：</label> 
						<input id="password" value="" name="password"  type="password" 
						class="password form-control x319 in">
					</div>
					<div class="form-group">
						<label for="password2" class="t">确认密码：</label> 
						<input id="password2" value="" name="password" type="password" 
						class="password form-control x319 in">
					</div>
					<div class="form-group space">
						<label class="t"></label>　　　
						<button type="button"  id="submit_btn" 
						class="btn btn-primary btn-lg"  onclick="tjxg()">&nbsp;修&nbsp;改&nbsp </button>
						<input type="reset" value="&nbsp;重&nbsp;置&nbsp;" class="btn btn-default btn-lg">
					</div>
				</form>
			</div>
		</div>
		<div class="bottom">Copyright &copy; 2016 - 2017 <a href="#">河南方正智慧城市发展有限公司</a></div>
	</div>
</div>




<div style="text-align:center;">

</div>
   <script>
        function tjxg(){
        var opassword=$('#opassword').val();
        var password=$('#password').val();
        var password2=$('#password2').val();
       var loginname=$('#loginname').val();
        if(password === password2){
          $.ajax({
                type: "POST",
                url: "{:U('Index/xgmm')}",
           
                cache: false,
                data: {
               loginname:loginname,
               opassword:opassword,
               password:password
                    
                },
         
                    success: function(data) {
                switch(data){
                           
                case '0':
                alert('修改成功');
                 window.location.href="{:U('Login/logout')}" ;
                break;
                case '1': 
                 alert('修改失败');
           
                break;
        case '3': 
                 alert('原始密码错误');
           
                break;
            default:
                alert(3);
        }
              
                       }

        });
        }else{
            
            alert("两次输入的密码不一致");
        }}
        </script>   
</body>
</html>